home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / tex / meta27 / mfpandor.lzh / panaccent.mf < prev    next >
Text File  |  1990-11-16  |  25KB  |  633 lines

  1. %*****************************************************************************
  2. %        Copyright (c) 1989 by N. N. Billawala
  3. %*****************************************************************************
  4.  
  5.  
  6. % accent.mf  miscellaneous accents, ligatures and chars for foreign languages
  7.  
  8. %19 characters; iff OK "x": for testing
  9.  
  10.  
  11.  
  12. iff OK "x":  "The letter i with no dot"; 
  13.   beginchar(oct"020",i_w*width#+a_mono#,xheight#,0); 
  14.  
  15.   bot z40=(if singlepitch:.65w else:.5w fi,0);  multpos(1,4,40)(stem.lc,0);      
  16.   lft x4l=round x40l; bot y4=0;  
  17.   z1=(x4,h)//; 
  18.   onaline(1l,4l)(2l,3l);   y3l=y3r=x_bracket_h;           
  19.   onaline(1r,4r)(2r,3r);   y2l=y2r=max(h-x_bracket_h,y3l);
  20.  
  21.   p1=fullserif(z4,z1,z3l,z3r,.75hs,.75hs)--
  22.      terminalserif.l(z1,z4,z2l,z2r,.5ts,x_terminal_angle)--cycle;
  23.   if singlepitch:pickup pencircle yscaled thin_stem.lc rotated -oblique;
  24.     lft top z12=(0,h); rt top z13=(x1,h); 
  25.     draw z12--z13; showpoints(12,13);
  26.     fi  
  27.  
  28.   showpoints(1,2,3,4,40);
  29. adjust(v_a*fitbasis.lc#+m_a*a_mfit#,v_a*fitbasis.lc#+m_a*a_mfit#); 
  30. show_character; endchar;
  31.  
  32. % Exactly the came character as the lowercase "i", but with no dot
  33.  
  34.  
  35.  
  36. iff OK "x":  "The letter j with no dot";
  37.   beginchar(oct"021",j_w*width#+a_mono#,xheight#,descender#);
  38.  
  39.   top rt z1r=(w,h)//;        multpos(1,4)(stem.lc,0);
  40.   rt z4r=(w,0);      
  41.   onaline(1l,4l)(2l,3l);     y3l=max(.25xheight,-d+(l_arch*(d+.25xheight)));
  42.   onaline(1r,4r)(2r,3r);     y3r=max(.25xheight,-d+(r_arch*(d+.25xheight)));
  43.   onaline(1,4)(11);          y11=y1+max(1,.2h);  y2l=y2r=h-x_bracket_h;
  44.   lft z6=(0,-.95d)//;      
  45.   save_num(knob)=min(bulb_thickness,.3*abs(x4l-x6));            
  46.   bot y5r=top y5l-minor_curve.lc=-d-ov_b.lc;
  47.   good_x_for(5r)(z6,z3r,.4)a;  good_x_for(5l)(z6+(knob,0),z3l,.4)b;
  48.  
  49.   p1=terminalserif.l(z1,z4,z2l,z2r,.5ts,x_terminal_angle)--z3l{downward} i_t
  50.      bulb.bl(z6,z5l,z5r,.5cs,knob,90) o_t z3r{upward}--cycle;
  51.  
  52.  if singlepitch:pickup pencircle yscaled thin_stem.lc rotated -oblique;
  53.     lft top z12=(.2w,h); rt top z13=(x1,h); 
  54.     draw z12--z13; showpoints(12,13);
  55.     fi  
  56.  
  57.   showpoints(1,2,3,4,5,6,11);
  58. adjust(m_ee*a_mfit#,v_a*fitbasis.lc#+m_e*a_mfit#);
  59. show_character; endchar;
  60.  
  61. % Exactly the came character as the lowercase "j", but with no dot
  62.  
  63.  
  64.  
  65. iff OK "x":  "Grave accent";     %******* .8 ACCENT WIDTH  x  1 ACCENT DEPTH
  66.   beginchar(oct"022",.8accent_w*width#+b_mono#,
  67.     accent_height#+xheight#+accent_depth#,0); 
  68.   top rt z1=(0,h)//;  
  69.   bot lft z2=(w,h-max(1,accent_depth))//;
  70.   p1=prime_accent(z1,z2,accent_thick_end,accent_thin_end);
  71.   showpoints(1,2);
  72.  
  73. draw (0,xheight)--(w,xheight);
  74. adjust(0+m_a*b_mfit#,0+m_a*b_mfit#); 
  75. show_character; endchar;
  76.  
  77.     
  78.  
  79. iff OK "x":  "Acute accent";     %******* .8 ACCENT WIDTH  x  1 ACCENT DEPTH
  80.   beginchar(oct"023",.8accent_w*width#+b_mono#,
  81.     accent_height#+xheight#+accent_depth#,0); 
  82.   top rt z1=(w,h)//;  
  83.   bot lft z2=(0,h-max(1,accent_depth))//;
  84.   p1=prime_accent(z1,z2,accent_thick_end,accent_thin_end);
  85.   showpoints(1,2);
  86.  
  87. draw (0,xheight)--(w,xheight);
  88. adjust(0+m_a*b_mfit#,0+m_a*b_mfit#); 
  89. show_character; endchar;
  90.  
  91.  
  92.  
  93. iff OK "x":  "Hachek accent";   %******* 1 ACCENT WIDTH  x  2/3 ACCENT DEPTH
  94.   beginchar(oct"024",accent_w*width#+b_mono#,
  95.     accent_height#+xheight#+2/3accent_depth#,0); 
  96.   save theta,adjustment;
  97.   top lft z1=(0,h)//;  
  98.   bot z2l=bot z22=(.5w,h-max(1,2/3accent_depth))//;
  99.   rt z3=(w,y1)//;   
  100.   pos2(.6[accent_thin_end,accent_thick_end],90);
  101.   pos22(min(apex.lc,.5stem.lc),0-apex_angle);
  102.   if y2=y1: x1:=x1+eps; fi      % keeps from division by 0 error on next line
  103.   if bold:theta1=theta3=0; adjustment=1/cosd (angle(z2-z1)+90); 
  104.     else:theta1=angle(z1-z2)-90;theta3=angle(z3-z2)-90;adjustment=1; fi
  105.   pos1(accent_thin_end*adjustment,theta1);
  106.   pos3(accent_thin_end*adjustment,theta3);
  107.   onaline(1,2)(23); onaline(1l,22l)(21);
  108.   onaline(2,3)(21); onaline(22r,3r)(23); 
  109.  
  110.   p1=if realsoft_accents: (z2r soften(z1r,z1l) z21{z21-z1l}...
  111.         z23{z3r-z23} soften(z3r,z3l) z2r)--cycle;
  112.        else: (z2r soften(z1r,z1l,z22l,z22r,z3r,z3l) z2r)--cycle; fi
  113.  
  114.   showpoints(1,2,3,21,22,23);
  115.  
  116. draw (0,xheight)--(w,xheight);
  117. adjust(0+m_a*b_mfit#,0+m_a*b_mfit#); 
  118. show_character; endchar;
  119.  
  120. % Currently the angle of the accent is based on a varying "accent_depth"
  121. % The thetas are the angles at the ends, flattened for bold chars,
  122. % but theta could be an arbitrary value
  123.  
  124.  
  125.  
  126. iff OK "x":  "Breve accent";   %******* 1 ACCENT WIDTH  x  2/3 ACCENT DEPTH
  127.   beginchar(oct"025",accent_w*width#+b_mono#,
  128.     accent_height#+xheight#+accent_depth#,0); 
  129.   save theta,adjustment;
  130.   save_num(thickness)=.5[accent_thin_end,accent_thick_end];
  131.   top lft z1l=(0,h)//; 
  132.   bot z2l=(.5w,h-accent_depth)//;
  133.   rt z3r=(w,y1l)//;
  134.   pos2(thickness,90);  
  135.   if y2l=y1l: x1l:=x1l+eps; fi    % keeps from division by 0 error on next line
  136.   ref1=z1l...z2l{right}; ref2=z3r...z2l{right};
  137.   if bold:theta1=theta3=0; adjustment=1/cosd (angle(direction 0 of ref1)+90); 
  138.     else:adjustment=1;
  139.          theta1=angle(direction 0 of ref1)+90;
  140.          theta3=angle(direction 0 of ref2)-90;fi
  141.   pos1(thickness*adjustment,theta1);
  142.   pos3(thickness*adjustment,theta3);
  143.   save_pair(end_dir)=if abs(y1l-y2l)>abs(x1l-x2l):upward else:(0,0) fi;
  144.  
  145.   p1=(z2l{right}...z3r{end_dir}
  146.         if softpath:)softjoin(z3r--z3l)softjoin( else:-- fi 
  147.       z3l{-end_dir}...z2r{left}...z1r{end_dir}
  148.         if softpath:)softjoin(z1r--z1l)softjoin( else:-- fi
  149.       z1l...z2l{right})--cycle;
  150.  
  151.   showpoints(1,2,3);
  152.  
  153. draw (0,xheight)--(w,xheight);
  154. adjust(0+m_a*b_mfit#,0+m_a*b_mfit#); 
  155. show_character; endchar;
  156.  
  157. % Currently the angle of the accent is based on a varying "accent_depth"
  158. % The thetas are the angles at the ends, flattened for bold chars,
  159. % but theta could be an arbitrary value
  160.  
  161.  
  162.  
  163. iff OK "x":  "Macron accent";   %******* 1 ACCENT WIDTH  x  .5 ACCENT DEPTH
  164.   beginchar(oct"026",accent_w*width#+b_mono#,
  165.     accent_height#+xheight#+accent_depth#,0); 
  166.   min_limit(join_radius)(.25[accent_thin_end,accent_thick_end]);
  167.   lft z1=(0,h-.5accent_depth)//;  
  168.   rt z3=(w,y1)//;
  169.   multpos(1,3)(.5[accent_thin_end,accent_thick_end],90);
  170.   z2l=.5[z1l,z3l];
  171.  
  172.   p1=(z2l soften(z3l,z3r,z1r,z1l) z2l)--cycle;
  173.  
  174.   showpoints(1,2,3);
  175.  
  176. draw (0,xheight)--(w,xheight);
  177. adjust(0+m_a*b_mfit#,0+m_a*b_mfit#); 
  178. show_character; endchar;
  179.  
  180.  
  181.  
  182. iff OK "x":  "Circle accent";   %******* 1 ACCENT WIDTH  x  ACCENT DEPTH
  183.   beginchar(oct"027",accent_w*width#+b_mono#,
  184.     accent_height#+xheight#+accent_depth#,0); 
  185.  
  186.   save thickness; 
  187.   thickness=min(.3[accent_thin_end,accent_thick_end],.3*accent_depth-1);
  188.   z0=(.5w,h-.5*max(2,accent_depth))//;
  189.   top z1r=(x0,h);                               pos1(thickness,90);
  190.   bot z3r=(x0,round(h-max(2,accent_depth)));    pos3(thickness,-90);
  191.   lft z2r=(round(x0-.5(y1r-y3r)),.5[y1r,y3r]);  pos2(thickness,180);
  192.   rt z4r=(round(x0+.5(y1r-y3r)),y2r);           pos4(thickness,0);
  193.  
  194.   p1 =z1r{left} o_t z2r{downward} o_t z3r{right} o_t z4r{upward} o_t cycle;
  195.   p1'=z1l{left} i_t z2l{downward} i_t z3l{right} i_t z4l{upward} i_t cycle;
  196.   
  197.   showpoints(1,2,3,4);
  198.  
  199. draw (0,xheight)--(w,xheight);
  200. adjust(0+m_a*b_mfit#,0+m_a*b_mfit#); 
  201. show_character; endchar;
  202.  
  203.  
  204.  
  205. iff OK "x":  "Cedilla";   %******* 1 ACCENT WIDTH  x  .75  ACCENT DEPTH
  206.   beginchar(oct"030",accent_w*width#+b_mono#,0,descender#); 
  207.  
  208.   bot lft z1l=(.35w,-min(.75accent_depth,d))//;
  209.   multpos(1,3)(max(.15accent_depth,accent_thin_end),90-oblique);
  210.   lft z4r=(.5w,0)//;                 pos4(.25accent_depth,80-oblique); 
  211.   rt z5r=lft z4r+(.5[accent_thin_end,accent_thick_end],0);
  212.   z3l=z4l;                           pos5(accent_depth,80-oblique); 
  213.   rt z2r=(w,.5[y1l,y3r])//;          pos2(accent_thick_end,0);
  214.   ref1=z2r{upward}...z3{left};
  215.   z20=ref1 intersectionpoint (z5r--z5l);
  216.   (t1,t2)=ref1 intersectiontimes (z5r--z5l);
  217.  
  218.   p1=(subpath(0,t1)of ref1--z5r--z4r--z4l   if softpath:)softjoin(z4l fi 
  219.       --z3l{right}...z2l{downward}...z1r{left}
  220.         if softpath:)softjoin(z1r--z1l)softjoin( else:-- fi 
  221.       z1l{right}...z2r{upward})--cycle;
  222.  
  223.   showpoints(1,2,3,4,5);
  224.  
  225. draw (0,xheight)--(w,xheight);
  226. adjust(0+m_a*b_mfit#,0+m_a*b_mfit#); 
  227. show_character; endchar;
  228.  
  229.  
  230.  
  231. iff OK "x":  "The Double S Ligature or scharfes S";  
  232.   beginchar(oct"031",b_w*width#+d_mono#,ascender#,0); 
  233.  
  234.   min_limit(join_radius)(.5*max(1,t